package com.tensquare.search.pojo;
/*
 *ClassName:Article
 *Description:文章实体类
 *@author:可爱的大鸭子
 */

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

@Document(indexName="tensquare",type="article") //建立索引和类型，用来全文检索，需要制定索引名称tensquare
public class Article {
    @Id
    private String id;                  //ID

    /*是否需要索引：看该域是否能被搜索
    * 是否需要存储：看该域是否需要在页面上显示
    * 是否需要分词：看搜索的时候是整体匹配还是单词匹配*/
    @Field(index=true,analyzer="ik_max_word",searchAnalyzer="ik_smart") //ik_max_word:
    private String title;               //标题
    @Field(index= true,analyzer="ik_max_word",searchAnalyzer="ik_max_word") //
    private String content;             //文章正文
    private String state;               //审核状态

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
